package com.sumainfor.pc.market.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 业主来源
 * @Auther: zhlu
 * @Date: 2018/11/11 18:13
 * @Description:
 */
@RestController
@RequestMapping("/so")
public class SourceController {

    @Autowired
    SourceService sourceService;

    /**
     * 功能描述:
     * 获取业主来源列表
     * @Author zhlu
     * @Description //TODO
     * @Date 2018/11/11 18:15
     */
    @GetMapping("/SelectSourceList")
    public JsonResult SelectSourceList(){
        JsonResult result=new JsonResult();
        List<Map<String,Object>> SelectSourceList=sourceService.SelectSourceList();
        if(SelectSourceList.size()<=0){
            result.putFailed("暂无业主来源！");
        }else{
            result.put(SelectSourceList);
        }
        return result;
    }

}
